package com.undefind;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	// write your code here
        while (true){
            GuessNumber game = new GuessNumber();
            game.generateNumber();
            Scanner input = new Scanner(System.in);
            while(true){
                if(game.getLife() <= 0){
                    break;
                }
                if(game.verifyAnswer(input.nextInt())){
                    break;
                }
            }
            System.out.println("游戏结束");
            System.out.println("1.再玩一局 2.退出游戏");
            if(input.nextInt() == 2)
                break;
        }
    }
}
